import Vue from 'vue'
import App from './App.vue'
// 引入路由组件
import router from './router'
import store from '@/store'
import TypeNav from './components/TypeNav'
import Pagination from '@/components/Pagination'
import Dialog from '@/components/Dialog'
import mock from '@/mockServer'
import 'swiper/css/swiper.css'
import {Button,Message} from 'element-ui'
import VueLazyload from 'vue-lazyload'
import load from '@/assets/loading.gif'

Vue.use(VueLazyload,{
  loading:load
})
// 全局注册TypeNav,Dialog 因为很多组件用到了TypeNav
Vue.component(TypeNav.name,TypeNav)
Vue.component(Dialog.name,Dialog)
//将分页器注册为全局组件
Vue.component(Pagination.name,Pagination)

Vue.component(Button.name,Button)
Vue.component(Message.name,Message)
Vue.prototype.$message = Message

Vue.config.productionTip = false

new Vue({
  render: h => h(App),
  beforeCreate(){
    Vue.prototype.$bus = this
  },
  router,
  store //得小写

}).$mount('#app')
